﻿@model Auction_Intranet.Models.BidsListModel           

<section class="bids-stats">
    <ul class="bids-stats-list">
        <li class="bids-stats-item">            
                <p class="num">@Model.pendingBids</p>
                <p class="text">Pending Bids</p>
        </li>
        <li class="bids-stats-item">
            <p class="num">@Model.acceptedBids</p>
            <p class="text">Accepted Bids</p>
        </li>
        <li class="bids-stats-item">
            <p class="num">@Model.declinedBids</p>
            <p class="text">Declined Bids</p>
        </li>
    </ul>
</section>

<div class="tabs-bids">
	<ul>
		<li><a href="#tabs-bids-1">All</a></li>
		<li><a href="#tabs-bids-2">Pending</a></li>
		<li><a href="#tabs-bids-3">Accepted</a></li>
        <li><a href="#tabs-bids-4">Declined</a></li>
	</ul>
	<div id="tabs-bids-1">
        <span class="bids-icon"></span>
        <ul class="bids-list">            
            <li class="bids-title-item">
                <span>Date</span>
                <span>Start</span>
                <span>End</span>
                <span>Room</span>
                <span>Group</span>
                <span class="amounts">Bidded</span>
                <span class="amounts">Paid</span>
                <span class="cancel-bid"></span>
            </li>           
            <li class="bids-list-item first"></li>
        @foreach (var item in Model.userBids) {
            <li class="bids-list-item">
                <span><span class="item-title">Date:</span><span class="item-name">@item.Date.ToShortDateString()</span></span>
                <span><span class="item-title">Start:</span><span class="item-name">@item.StartTime.ToShortTimeString()</span></span>
                <span><span class="item-title">End:</span><span class="item-name">@item.EndTime.ToShortTimeString()</span></span>                
                <span><span class="item-title">Room:</span>
                @if (item.AnyRoom == true)
                {
                    <span class="item-name">Any</span>
                }
                else 
                { 
                    <span class="item-name">@Html.DisplayFor(modelItem => item.Room.Name)</span> 
                }
                </span>
                <span><span class="item-title">Group:</span><span class="item-name">@FileHelper.Truncate(item.Group.Name,10)</span></span>
                <span class="amounts amounts-cell"><span class="item-title">Bid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.BiddingAmount)</span></span>
                <span class="amounts amounts-cell"><span class="item-title">Paid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.PaidAmount)</span></span>
                <span class="cancel-bid">
                @if (item.State.Id == 1)
                { 
                    @Html.ActionLink("Cancel", "Delete", "Bids", new { id = item.Id }, new{title="delete bid" })
                }
                </span>
            </li>
        }
            <li class="bids-list-item last"></li>
        </ul>
	</div>
	<div id="tabs-bids-2">
        <span class="bids-icon"></span>
        <ul class="bids-list">
            <li class="bids-title-item">
                <span>Date</span>
                <span>Start</span>
                <span>End</span>
                <span>Room</span>
                <span>Group</span>
                <span class="amounts">Bidded</span>
                <span class="amounts">Paid</span>
                <span class="cancel-bid"></span>
            </li>
            <li class="bids-list-item first"></li>
        @foreach (var item in Model.userBids.Where(x => x.State.Name == "Pending"))
        {            
            <li class="bids-list-item">
                <span><span class="item-title">Date:</span><span class="item-name">@item.Date.ToShortDateString()</span></span>
                <span><span class="item-title">Start:</span><span class="item-name">@item.StartTime.ToShortTimeString()</span></span>
                <span><span class="item-title">End:</span><span class="item-name">@item.EndTime.ToShortTimeString()</span></span>
                <span><span class="item-title">Room:</span>
                @if (item.AnyRoom == true)
                {
                    <span class="item-name">Any</span>
                }
                else 
                { 
                    <span class="item-name">@Html.DisplayFor(modelItem => item.Room.Name)</span> 
                }
                </span>
                <span><span class="item-title">Group:</span><span class="item-name">@Html.DisplayFor(modelItem => item.Group.Name)</span></span>              
                <span class="amounts amounts-cell"><span class="item-title">Bid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.BiddingAmount)</span></span>
                <span class="amounts amounts-cell"><span class="item-title">Paid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.PaidAmount)</span></span>
                <span class="cancel-bid">
                @if (item.State.Id == 1)
                { 
                    @Html.ActionLink("Cancel", "Delete", "Bids", new { id = item.Id }, new{title="delete bid" })
                }
                </span>
            </li>
        }
            <li class="bids-list-item last"></li>
        </ul>		
	</div>
	<div id="tabs-bids-3">
        <span class="bids-icon"></span>
        <ul class="bids-list">
            <li class="bids-title-item">
                <span>Date</span>
                <span>Start</span>
                <span>End</span>
                <span>Room</span>
                <span>Group</span>
                <span class="amounts">Bidded</span>
                <span class="amounts">Paid</span>
                <span class="cancel-bid"></span>
            </li>
            <li class="bids-list-item first"></li>
        @foreach (var item in Model.userBids.Where(x => x.State.Name == "Accepted"))
        {
            <li class="bids-list-item">
                <span><span class="item-title">Date:</span><span class="item-name">@item.Date.ToShortDateString()</span></span>
                <span><span class="item-title">Start:</span><span class="item-name">@item.StartTime.ToShortTimeString()</span></span>
                <span><span class="item-title">End:</span><span class="item-name">@item.EndTime.ToShortTimeString()</span></span>
                <span><span class="item-title">Room:</span>
                @if (item.AnyRoom == true)
                {
                    <span class="item-name">Any</span>
                }
                else
                { 
                    <span class="item-name">@Html.DisplayFor(modelItem => item.Room.Name)</span> 
                }
                </span>
                <span><span class="item-title">Group:</span><span class="item-name">@Html.DisplayFor(modelItem => item.Group.Name)</span></span>              
                <span class="amounts amounts-cell"><span class="item-title">Bid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.BiddingAmount)</span></span>
                <span class="amounts amounts-cell"><span class="item-title">Paid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.PaidAmount)</span></span>
                <span class="cancel-bid">
                @if (item.State.Id == 1)
                { 
                    @Html.ActionLink("Cancel", "Delete", "Bids", new { id = item.Id }, new { title = "delete bid" })
                }
                </span>
            </li>
        }
            <li class="bids-list-item last"></li>
        </ul>		
	</div>
	<div id="tabs-bids-4">
        <span class="bids-icon"></span>
        <ul class="bids-list">
            <li class="bids-title-item">
                <span>Date</span>
                <span>Start</span>
                <span>End</span>
                <span>Room</span>
                <span>Group</span>
                <span class="amounts">Bidded</span>
                <span class="amounts">Paid</span>
                <span class="cancel-bid"></span>
            </li>
            <li class="bids-list-item first"></li>
        @foreach (var item in Model.userBids.Where(x => x.State.Name == "Declined"))
        {
            <li class="bids-list-item">
                <span><span class="item-title">Date:</span><span class="item-name">@item.Date.ToShortDateString()</span></span>
                <span><span class="item-title">Start:</span><span class="item-name">@item.StartTime.ToShortTimeString()</span></span>
                <span><span class="item-title">End:</span><span class="item-name">@item.EndTime.ToShortTimeString()</span></span>
                <span><span class="item-title">Room:</span>
                @if (item.AnyRoom == true)
                {
                    <span class="item-name">Any</span>
                }
                else
                { 
                    <span class="item-name">@Html.DisplayFor(modelItem => item.Room.Name)</span> 
                }
                </span>
                <span><span class="item-title">Group:</span><span class="item-name">@Html.DisplayFor(modelItem => item.Group.Name)</span></span>               
                <span class="amounts amounts-cell"><span class="item-title">Bid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.BiddingAmount)</span></span>
                <span class="amounts amounts-cell"><span class="item-title">Paid amount:</span><span class="item-name">&#160;&#160;@Html.DisplayFor(modelItem => item.PaidAmount)</span></span>
                <span class="cancel-bid">
                @if (item.State.Id == 1)
                { 
                    @Html.ActionLink("Cancel", "Delete", "Bids", new { id = item.Id }, new { title = "delete bid" })
                }
                </span>
            </li>
        }
            <li class="bids-list-item last"></li>
        </ul>	
    </div>
</div>